package reflect;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("reflect.Person");
        Method method = cls.getMethod("study");
        if (method.isAnnotationPresent(AutoRunMethod.class)==  true){
            int value = method.getAnnotation(AutoRunMethod.class).value();
            System.out.println(value);
        }else {
            System.out.println("方法 " + method.getName() + " 没有被@AutoRunMethod标注");
        }

    }
}